package com.yc.cloudvideo.sp_store.mapper;

import com.yc.cloudvideo.entity.File;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yc.cloudvideo.entity.StoreFile;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author LYYT
 * @since 2022-08-03
 */
public interface FileMapper extends BaseMapper<File> {
    @Select("select * from file where fid=#{fid}")
    @Results(value = {
            @Result(property = "uid",column = "uid",id = true),
            @Result(property = "user",column = "uid",
                    one = @One(select = "com.yc.cloudvideo.sp_store.mapper.UserMapper.selectUserByUid"))
    })
    File selectFileByFid(int fid);

    @Select("select * from file where path=#{path}")
    @Results(value = {
            @Result(property = "uid",column = "uid",id = true),
            @Result(property = "user",column = "uid",
                    one = @One(select = "com.yc.cloudvideo.sp_store.mapper.UserMapper.selectUserByUid"))
    })
    File selectFileByPath(String path);


}
